//
//  TableShowViewCell+Config.swift
//  CooperSwift
//
//  Created by 计海峰 on 2021/12/9.
//

import UIKit
import RxSwift

public extension TableShowViewCell {
    
    /// 写布局
    func layoutViews() {
        contentView.addSubview(view)
        view.snp.makeConstraints { make in
            make.edges.equalToSuperview().inset(UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0))
        }
    }
    
    // MARK: - bind后 执行
    func loadData() {
        guard let cellModel = self.info as? TableShowViewCellModel else { return }
        // 执行一次配置
        if !cellModel.isConfigDone {
            cellModel.isConfigDone = true
            cellModel.once(view, cell: self)
        }
        cellModel.every(view, cell: self)
    }

}
